<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich">
    <style type="text/css">
        .col, .col2 {
            width:50%;
            vertical-align:top;
        }
        .gridhello {
            border-collapse : collapse;
        }
        .gridhellocolumn {
            padding-left : 0;
        }
        .pic{
            margin-bottom: -4px;
            margin-right: 2px;
            border:none;
        }
    </style>
    <h:form id="goodstype">
        <rich:panel header="合同内容">            
            <rich:toolbar  itemSeparator="grid">
                <rich:toolbarGroup>
                    <h:commandButton value="新建" action="#{goodsType.add}"/>
                    <h:commandButton value="修改" action="#{goodsType.update}" disabled="#{goodsType.addOrUpdate || goodsType.gtype.code eq ''}"/>
                    <h:commandButton value="删除" action="#{goodsType.delete}" disabled="#{!goodsType.showAble}"/>
                    <h:commandButton value="保存" action="#{goodsType.save}" disabled="#{!goodsType.showAble}"/>
                    <h:commandButton value="取消" action="#{goodsType.cancel}" disabled="#{!goodsType.showAble}"/>
                </rich:toolbarGroup>
            </rich:toolbar>
            <h:panelGrid columns="2" id="goodsTypeinfo">
                <h:outputLabel value="代码：" for="code"/>
                <h:inputText id="code" value="#{goodsType.gtype.code}" disabled= "#{!goodsType.showAble}"/>

                <h:outputLabel value="名称：" for="name"/>
                <h:inputText id="name" value="#{goodsType.gtype.name}" disabled= "#{!goodsType.showAble}"/>

                <h:outputText value="备注："/>
                <h:inputText value="#{goodsType.gtype.memo}" disabled= "#{!goodsType.showAble}"/>
            </h:panelGrid> 
            <br/>
            <hr/>
            <rich:dataTable id="editTable" value="#{goodsType.typeModel}" var="gtype"
                             rowClasses="list-row-odd,list-row-even"
                            headerClass="table-header" >
                <rich:column>
                    <f:facet name="header">
                        <h:panelGroup>
                            <h:outputText value="代码"/>
                        </h:panelGroup>
                    </f:facet>
                    <h:commandLink action="#{goodsType.show}">
                        <h:outputText value="#{gtype.code}"/>
                    </h:commandLink>
                </rich:column>
                <rich:column>
                    <f:facet name="header">
                        <h:panelGroup>
                            <h:outputText value="名称"/>
                        </h:panelGroup>
                    </f:facet>
                    <h:outputText value="#{gtype.name}"/>
                </rich:column>
                <rich:column>
                    <f:facet name="header">
                        <h:panelGroup>
                            <h:outputText value="备注"/>
                        </h:panelGroup>
                    </f:facet>
                    <h:outputText value="#{gtype.memo}"/>
                </rich:column>
            </rich:dataTable>
        </rich:panel>
    </h:form>
</ui:composition>